]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Don't use a member variable when we can use a local
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 3 Jun 2014 18:26:59 +0000 (14:26 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 12 Jun 2014 17:31:39 +0000 (13:31 -0400)
Tiny cleanup.

js/ui/messageTray.js

index d7d09814227d9c1674fcc7a75d4196dceb2ac260..bbad8616caa19ae66d073560ffe7c3f4077b6de8 100644 (file)
@@ -504,7 +504,6 @@ const Notification = new Lang.Class({
         this.bannerBodyMarkup = false;
         this._bannerBodyAdded = false;
         this._titleFitsInBannerMode = true;
-        this._titleDirection = Clutter.TextDirection.DEFAULT;
         this._spacing = 0;
         this._scrollPolicy = Gtk.PolicyType.AUTOMATIC;
         this._imageBin = null;
@@ -643,10 +642,11 @@ const Notification = new Lang.Class({
         title = title ? _fixMarkup(title.replace(/\n/g, ' '), false) : '';
         this._titleLabel.clutter_text.set_markup('<b>' + title + '</b>');
 
+        let titleDirection;
         if (Pango.find_base_dir(title, -1) == Pango.Direction.RTL)
-            this._titleDirection = Clutter.TextDirection.RTL;
+            titleDirection = Clutter.TextDirection.RTL;
         else
-            this._titleDirection = Clutter.TextDirection.LTR;
+            titleDirection = Clutter.TextDirection.LTR;
 
         // Let the title's text direction control the overall direction
         // of the notification - in case where different scripts are used
@@ -654,7 +654,7 @@ const Notification = new Lang.Class({
         // arguably for action buttons as well. Labels other than the title
         // will be allocated at the available width, so that their alignment
         // is done correctly automatically.
-        this._table.set_text_direction(this._titleDirection);
+        this._table.set_text_direction(titleDirection);
 
         // Unless the notification has custom content, we save this.bannerBodyText
         // to add it to the content of the notification if the notification is